﻿package com.fatgirl.baseUI
{
	import com.fatgirl.core.IView;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class BaseView extends Sprite implements IView
	{
		
		private var m_container:DisplayObjectContainer
		public function BaseView()
		{
			super();
			this.addEventListener(MouseEvent.CLICK,clickHandler);
		}
		
		public function show(_container:DisplayObjectContainer):void
		{
			if(_container!=null)
			{
				_container.addChild(this);
			}
			m_container = _container;
		}
		
		public function close():void
		{
			if(m_container!=null)
			{
				m_container.removeChild(this);
			}
		}
		private function clickHandler(e:MouseEvent):void
		{
			e.stopPropagation();
		}
	}
}